package de.wittekind.bundesjugendspiele.client.management.ui.view;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JPanel;

import de.wittekind.bundesjugendspiele.client.management.ui.UIController;

public class DetailView extends JPanel {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -7654470488770230318L;

	JButton save;
	
	protected UIController ui;
	int i;
	int j;

	public DetailView(UIController ui) {
		this.ui = ui;
		GridBagLayout layout = new GridBagLayout();

		
		this.setLayout(layout);
	}
	
	
	public void addActionListener (ActionListener al) {
		save.addActionListener(al);
	}
	
	protected GridBagConstraints getStandardConstraints(  ) {
		GridBagConstraints c = new GridBagConstraints();
		c.fill = GridBagConstraints.NONE;
		c.gridx = i;
		c.gridy = j;
		c.weightx = 1.0;
		c.weighty = 1.0;
		c.ipadx = 10;
		if ( i == 1 ) { 
			i = 0;
			j++;
			c.anchor = GridBagConstraints.WEST;
		}
		else {
			i++;
			c.anchor = GridBagConstraints.EAST;
		}
		return c;
	}
	
	
}
